﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WXYW.BLL;
using System.Text;

namespace WXYW
{
    public partial class UserRegister : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// 绑定城市
        public List<ListItem> BindCity(string provinceName)
        {
            List<ListItem> cities = new List<ListItem>();
            switch (provinceName)
            {
                case "北京":
                    break;
                case "上海":
                    break;
                case "黑龙江":
                    cities.Add(new ListItem("哈尔滨市", "哈尔滨市"));
                    cities.Add(new ListItem("七台河市", "七台河市"));
                    cities.Add(new ListItem("齐齐哈尔市", "齐齐哈尔市"));
                    cities.Add(new ListItem("黑河市", "黑河市"));
                    cities.Add(new ListItem("大庆市", "大庆市"));
                    cities.Add(new ListItem("鹤岗市", "鹤岗市"));
                    cities.Add(new ListItem("伊春市", "伊春市"));
                    cities.Add(new ListItem("佳木斯市", "佳木斯市"));
                    cities.Add(new ListItem("双鸭山市", "双鸭山市"));
                    cities.Add(new ListItem("鸡西市", "鸡西市"));
                    cities.Add(new ListItem("牡丹江市", "牡丹江市"));
                    cities.Add(new ListItem("绥化市", "绥化市"));
                    cities.Add(new ListItem("大兴安岭地区(加格达奇)", "大兴安岭地区(加格达奇)"));
                    break;
                case "吉林":
                    cities.Add(new ListItem("长春市", "长春市"));
                    cities.Add(new ListItem("白城市", "白城市"));
                    cities.Add(new ListItem("松原市", "松原市"));
                    cities.Add(new ListItem("吉林市", "吉林市"));
                    cities.Add(new ListItem("四平市", "四平市"));
                    cities.Add(new ListItem("辽源市", "辽源市"));
                    cities.Add(new ListItem("通化市", "通化市"));
                    cities.Add(new ListItem("白山市", "白山市"));
                    cities.Add(new ListItem("延边朝鲜族自治州", "延边朝鲜族自治州"));
                    break;
                case "辽宁":
                    cities.Add(new ListItem("沈阳市", "沈阳市"));
                    cities.Add(new ListItem("朝阳市", "朝阳市"));
                    cities.Add(new ListItem("阜新市", "阜新市"));
                    cities.Add(new ListItem("铁岭市", "铁岭市"));
                    cities.Add(new ListItem("抚顺市", "抚顺市"));
                    cities.Add(new ListItem("本溪市", "本溪市"));
                    cities.Add(new ListItem("辽阳市", "辽阳市"));
                    cities.Add(new ListItem("鞍山市", "鞍山市"));
                    cities.Add(new ListItem("丹东市", "丹东市"));
                    cities.Add(new ListItem("大连市", "大连市"));
                    cities.Add(new ListItem("营口市", "营口市"));
                    cities.Add(new ListItem("盘锦市", "盘锦市"));
                    cities.Add(new ListItem("锦州市", "锦州市"));
                    cities.Add(new ListItem("葫芦岛市", "葫芦岛市"));
                    break;
                case "天津":
                    break;
                case "安徽":
                    cities.Add(new ListItem("合肥市", "合肥市"));
                    cities.Add(new ListItem("宿州市", "宿州市"));
                    cities.Add(new ListItem("淮北市", "淮北市"));
                    cities.Add(new ListItem("亳州市", "亳州市"));
                    cities.Add(new ListItem("阜阳市", "阜阳市"));
                    cities.Add(new ListItem("蚌埠市", "蚌埠市"));
                    cities.Add(new ListItem("淮南市", "淮南市"));
                    cities.Add(new ListItem("滁州市", "滁州市"));
                    cities.Add(new ListItem("马鞍山市", "马鞍山市"));
                    cities.Add(new ListItem("芜湖市", "芜湖市"));
                    cities.Add(new ListItem("铜陵市", "铜陵市"));
                    cities.Add(new ListItem("安庆市", "安庆市"));
                    cities.Add(new ListItem("黄山市", "黄山市"));
                    cities.Add(new ListItem("六安市", "六安市"));
                    cities.Add(new ListItem("巢湖市", "巢湖市"));
                    cities.Add(new ListItem("池州市", "池州市"));
                    cities.Add(new ListItem("宣城市", "宣城市"));
                    break;
                case "江苏":
                    cities.Add(new ListItem("南京市", "南京市"));
                    cities.Add(new ListItem("徐州市", "徐州市"));
                    cities.Add(new ListItem("连云港市", "连云港市"));
                    cities.Add(new ListItem("宿迁市", "宿迁市"));
                    cities.Add(new ListItem("淮安市", "淮安市"));
                    cities.Add(new ListItem("盐城市", "盐城市"));
                    cities.Add(new ListItem("扬州市", "扬州市"));
                    cities.Add(new ListItem("泰州市", "泰州市"));
                    cities.Add(new ListItem("南通市", "南通市"));
                    cities.Add(new ListItem("镇江市", "镇江市"));
                    cities.Add(new ListItem("常州市", "常州市"));
                    cities.Add(new ListItem("无锡市", "无锡市"));
                    cities.Add(new ListItem("苏州市", "苏州市"));
                    break;
                case "浙江":
                    cities.Add(new ListItem("杭州市", "杭州市"));
                    cities.Add(new ListItem("湖州市", "湖州市"));
                    cities.Add(new ListItem("嘉兴市", "嘉兴市"));
                    cities.Add(new ListItem("舟山市", "舟山市"));
                    cities.Add(new ListItem("宁波市", "宁波市"));
                    cities.Add(new ListItem("绍兴市", "绍兴市"));
                    cities.Add(new ListItem("衢州市", "衢州市"));
                    cities.Add(new ListItem("金华市", "金华市"));
                    cities.Add(new ListItem("台州市", "台州市"));
                    cities.Add(new ListItem("温州市", "温州市"));
                    cities.Add(new ListItem("丽水市", "丽水市"));
                    break;
                case "陕西":
                    cities.Add(new ListItem("西安市", "西安市"));
                    cities.Add(new ListItem("延安市", "延安市"));
                    cities.Add(new ListItem("铜川市", "铜川市"));
                    cities.Add(new ListItem("渭南市", "渭南市"));
                    cities.Add(new ListItem("咸阳市", "咸阳市"));
                    cities.Add(new ListItem("宝鸡市", "宝鸡市"));
                    cities.Add(new ListItem("汉中市", "汉中市"));
                    cities.Add(new ListItem("榆林市", "榆林市"));
                    cities.Add(new ListItem("安康市", "安康市"));
                    cities.Add(new ListItem("商洛市", "商洛市"));
                    break;
                case "湖北":
                    cities.Add(new ListItem("武汉市", "武汉市"));
                    cities.Add(new ListItem("十堰市", "十堰市"));
                    cities.Add(new ListItem("襄樊市", "襄樊市"));
                    cities.Add(new ListItem("荆门市", "荆门市"));
                    cities.Add(new ListItem("孝感市", "孝感市"));
                    cities.Add(new ListItem("黄冈市", "黄冈市"));
                    cities.Add(new ListItem("鄂州市", "鄂州市"));
                    cities.Add(new ListItem("黄石市", "黄石市"));
                    cities.Add(new ListItem("咸宁市", "咸宁市"));
                    cities.Add(new ListItem("荆州市", "荆州市"));
                    cities.Add(new ListItem("宜昌市", "宜昌市"));
                    cities.Add(new ListItem("随州市", "随州市"));
                    cities.Add(new ListItem("恩施土家族苗族自治州", "恩施土家族苗族自治州"));
                    break;
                case "广东":
                    cities.Add(new ListItem("广州市", "广州市"));
                    cities.Add(new ListItem("清远市", "清远市"));
                    cities.Add(new ListItem("韶关市", "韶关市"));
                    cities.Add(new ListItem("河源市", "河源市"));
                    cities.Add(new ListItem("梅州市", "梅州市"));
                    cities.Add(new ListItem("潮州市", "潮州市"));
                    cities.Add(new ListItem("汕头市", "汕头市"));
                    cities.Add(new ListItem("揭阳市", "揭阳市"));
                    cities.Add(new ListItem("汕尾市", "汕尾市"));
                    cities.Add(new ListItem("惠州市", "惠州市"));
                    cities.Add(new ListItem("东莞市", "东莞市"));
                    cities.Add(new ListItem("深圳市", "深圳市"));
                    cities.Add(new ListItem("珠海市", "珠海市"));
                    cities.Add(new ListItem("中山市", "中山市"));
                    cities.Add(new ListItem("江门市", "江门市"));
                    cities.Add(new ListItem("佛山市", "佛山市"));
                    cities.Add(new ListItem("肇庆市", "肇庆市"));
                    cities.Add(new ListItem("云浮市", "云浮市"));
                    cities.Add(new ListItem("阳江市", "阳江市"));
                    cities.Add(new ListItem("茂名市", "茂名市"));
                    cities.Add(new ListItem("湛江市", "湛江市"));
                    break;
                case "湖南":
                    cities.Add(new ListItem("长沙市", "长沙市"));
                    cities.Add(new ListItem("张家界市", "张家界市"));
                    cities.Add(new ListItem("常德市", "常德市"));
                    cities.Add(new ListItem("益阳市", "益阳市"));
                    cities.Add(new ListItem("岳阳市", "岳阳市"));
                    cities.Add(new ListItem("株洲市", "株洲市"));
                    cities.Add(new ListItem("湘潭市", "湘潭市"));
                    cities.Add(new ListItem("衡阳市", "衡阳市"));
                    cities.Add(new ListItem("郴州市", "郴州市"));
                    cities.Add(new ListItem("永州市", "永州市"));
                    cities.Add(new ListItem("邵阳市", "邵阳市"));
                    cities.Add(new ListItem("怀化市", "怀化市"));
                    cities.Add(new ListItem("娄底市", "娄底市"));
                    cities.Add(new ListItem("湘西土家族苗族自治州", "湘西土家族苗族自治州"));
                    break;
                case "甘肃":
                    cities.Add(new ListItem("兰州市", "兰州市"));
                    cities.Add(new ListItem("嘉峪关市", "嘉峪关市"));
                    cities.Add(new ListItem("金昌市", "金昌市"));
                    cities.Add(new ListItem("白银市", "白银市"));
                    cities.Add(new ListItem("天水市", "天水市"));
                    cities.Add(new ListItem("武威市", "武威市"));
                    cities.Add(new ListItem("酒泉市", "酒泉市"));
                    cities.Add(new ListItem("张掖市", "张掖市"));
                    cities.Add(new ListItem("庆阳市", "庆阳市"));
                    cities.Add(new ListItem("平凉市", "平凉市"));
                    cities.Add(new ListItem("定西市", "定西市"));
                    cities.Add(new ListItem("陇南市", "陇南市"));
                    cities.Add(new ListItem("临夏回族自治州", "临夏回族自治州"));
                    cities.Add(new ListItem("甘南藏族自治州", "甘南藏族自治州"));
                    break;
                case "四川":
                    cities.Add(new ListItem("成都市", "成都市"));
                    cities.Add(new ListItem("广元市", "广元市"));
                    cities.Add(new ListItem("绵阳市", "绵阳市"));
                    cities.Add(new ListItem("德阳市", "德阳市"));
                    cities.Add(new ListItem("南充市", "南充市"));
                    cities.Add(new ListItem("广安市", "广安市"));
                    cities.Add(new ListItem("遂宁市", "遂宁市"));
                    cities.Add(new ListItem("内江市", "内江市"));
                    cities.Add(new ListItem("乐山市", "乐山市"));
                    cities.Add(new ListItem("自贡市", "自贡市"));
                    cities.Add(new ListItem("泸州市", "泸州市"));
                    cities.Add(new ListItem("宜宾市", "宜宾市"));
                    cities.Add(new ListItem("攀枝花市", "攀枝花市"));
                    cities.Add(new ListItem("巴中市", "巴中市"));
                    cities.Add(new ListItem("达州市", "达州市"));
                    cities.Add(new ListItem("资阳市", "资阳市"));
                    cities.Add(new ListItem("眉山市", "眉山市"));
                    cities.Add(new ListItem("雅安市", "雅安市"));
                    cities.Add(new ListItem("阿坝藏族羌族自治州", "阿坝藏族羌族自治州"));
                    cities.Add(new ListItem("甘孜藏族自治州", "甘孜藏族自治州"));
                    cities.Add(new ListItem("凉山彝族自治州", "凉山彝族自治州"));
                    break;
                case "山东":
                    cities.Add(new ListItem("济南市", "济南市"));
                    cities.Add(new ListItem("聊城市", "聊城市"));
                    cities.Add(new ListItem("德州市", "德州市"));
                    cities.Add(new ListItem("东营市", "东营市"));
                    cities.Add(new ListItem("淄博市", "淄博市"));
                    cities.Add(new ListItem("潍坊市", "潍坊市"));
                    cities.Add(new ListItem("烟台市", "烟台市"));
                    cities.Add(new ListItem("威海市", "威海市"));
                    cities.Add(new ListItem("青岛市", "青岛市"));
                    cities.Add(new ListItem("日照市", "日照市"));
                    cities.Add(new ListItem("临沂市", "临沂市"));
                    cities.Add(new ListItem("枣庄市", "枣庄市"));
                    cities.Add(new ListItem("济宁市", "济宁市"));
                    cities.Add(new ListItem("泰安市", "泰安市"));
                    cities.Add(new ListItem("莱芜市", "莱芜市"));
                    cities.Add(new ListItem("滨州市", "滨州市"));
                    cities.Add(new ListItem("菏泽市", "菏泽市"));
                    break;
                case "福建":
                    cities.Add(new ListItem("福州市", "福州市"));
                    cities.Add(new ListItem("南平市", "南平市"));
                    cities.Add(new ListItem("莆田市", "莆田市"));
                    cities.Add(new ListItem("三明市", "三明市"));
                    cities.Add(new ListItem("泉州市", "泉州市"));
                    cities.Add(new ListItem("厦门市", "厦门市"));
                    cities.Add(new ListItem("漳州市", "漳州市"));
                    cities.Add(new ListItem("龙岩市", "龙岩市"));
                    cities.Add(new ListItem("宁德市", "宁德市"));
                    break;
                case "河南":
                    cities.Add(new ListItem("郑州市", "郑州市"));
                    cities.Add(new ListItem("三门峡市", "三门峡市"));
                    cities.Add(new ListItem("洛阳市", "洛阳市"));
                    cities.Add(new ListItem("焦作市", "焦作市"));
                    cities.Add(new ListItem("新乡市", "新乡市"));
                    cities.Add(new ListItem("鹤壁市", "鹤壁市"));
                    cities.Add(new ListItem("安阳市", "安阳市"));
                    cities.Add(new ListItem("濮阳市", "濮阳市"));
                    cities.Add(new ListItem("开封市", "开封市"));
                    cities.Add(new ListItem("商丘市", "商丘市"));
                    cities.Add(new ListItem("许昌市", "许昌市"));
                    cities.Add(new ListItem("漯河市", "漯河市"));
                    cities.Add(new ListItem("平顶山市", "平顶山市"));
                    cities.Add(new ListItem("南阳市", "南阳市"));
                    cities.Add(new ListItem("信阳市", "信阳市"));
                    cities.Add(new ListItem("周口市", "周口市"));
                    cities.Add(new ListItem("驻马店市", "驻马店市"));
                    break;
                case "重庆":
                    break;
                case "云南":
                    cities.Add(new ListItem("昆明市", "昆明市"));
                    cities.Add(new ListItem("曲靖市", "曲靖市"));
                    cities.Add(new ListItem("玉溪市", "玉溪市"));
                    cities.Add(new ListItem("保山市", "保山市"));
                    cities.Add(new ListItem("昭通市", "昭通市"));
                    cities.Add(new ListItem("丽江市", "丽江市"));
                    cities.Add(new ListItem("普洱市", "普洱市"));
                    cities.Add(new ListItem("临沧市", "临沧市"));
                    cities.Add(new ListItem("德宏傣族景颇族自治州", "德宏傣族景颇族自治州"));
                    cities.Add(new ListItem("怒江傈僳族自治州(泸水县六库镇)", "怒江傈僳族自治州(泸水县六库镇)"));
                    cities.Add(new ListItem("迪庆藏族自治州", "迪庆藏族自治州"));
                    cities.Add(new ListItem("大理白族自治州", "大理白族自治州"));
                    cities.Add(new ListItem("楚雄彝族自治州", "楚雄彝族自治州"));
                    cities.Add(new ListItem("红河哈尼族彝族自治州", "红河哈尼族彝族自治州"));
                    cities.Add(new ListItem("文山壮族苗族自治州", "文山壮族苗族自治州"));
                    cities.Add(new ListItem("西双版纳傣族自治州", "西双版纳傣族自治州"));
                    break;
                case "河北":
                    cities.Add(new ListItem("石家庄市", "石家庄市"));
                    cities.Add(new ListItem("张家口市", "张家口市"));
                    cities.Add(new ListItem("承德市", "承德市"));
                    cities.Add(new ListItem("秦皇岛市", "秦皇岛市"));
                    cities.Add(new ListItem("唐山市", "唐山市"));
                    cities.Add(new ListItem("廊坊市", "廊坊市"));
                    cities.Add(new ListItem("保定市", "保定市"));
                    cities.Add(new ListItem("衡水市", "衡水市"));
                    cities.Add(new ListItem("沧州市", "沧州市"));
                    cities.Add(new ListItem("邢台市", "邢台市"));
                    cities.Add(new ListItem("邯郸市", "邯郸市"));
                    break;
                case "江西":
                    cities.Add(new ListItem("南昌市", "南昌市"));
                    cities.Add(new ListItem("九江市", "九江市"));
                    cities.Add(new ListItem("景德镇市", "景德镇市"));
                    cities.Add(new ListItem("鹰潭市", "鹰潭市"));
                    cities.Add(new ListItem("新余市", "新余市"));
                    cities.Add(new ListItem("萍乡市", "萍乡市"));
                    cities.Add(new ListItem("赣州市", "赣州市"));
                    cities.Add(new ListItem("上饶市", "上饶市"));
                    cities.Add(new ListItem("抚州市", "抚州市"));
                    cities.Add(new ListItem("宜春市", "宜春市"));
                    cities.Add(new ListItem("吉安市", "吉安市"));
                    break;
                case "山西":
                    cities.Add(new ListItem("太原市", "太原市"));
                    cities.Add(new ListItem("朔州市", "朔州市"));
                    cities.Add(new ListItem("大同市", "大同市"));
                    cities.Add(new ListItem("阳泉市", "阳泉市"));
                    cities.Add(new ListItem("长治市", "长治市"));
                    cities.Add(new ListItem("晋城市", "晋城市"));
                    cities.Add(new ListItem("忻州市", "忻州市"));
                    cities.Add(new ListItem("晋中市", "晋中市"));
                    cities.Add(new ListItem("临汾市", "临汾市"));
                    cities.Add(new ListItem("吕梁市", "吕梁市"));
                    cities.Add(new ListItem("运城市", "运城市"));
                    break;
                case "贵州":
                    cities.Add(new ListItem("贵阳市", "贵阳市"));
                    cities.Add(new ListItem("六盘水市", "六盘水市"));
                    cities.Add(new ListItem("遵义市", "遵义市"));
                    cities.Add(new ListItem("安顺市", "安顺市"));
                    cities.Add(new ListItem("毕节地区", "毕节地区"));
                    cities.Add(new ListItem("铜仁地区", "铜仁地区"));
                    cities.Add(new ListItem("黔东南苗族侗族自治州", "黔东南苗族侗族自治州"));
                    cities.Add(new ListItem("黔南布依族苗族自治州", "黔南布依族苗族自治州"));
                    cities.Add(new ListItem("黔西南布依族苗族自治州", "黔西南布依族苗族自治州"));
                    break;
                case "广西":
                    cities.Add(new ListItem("南宁市", "南宁市"));
                    cities.Add(new ListItem("桂林市", "桂林市"));
                    cities.Add(new ListItem("柳州市", "柳州市"));
                    cities.Add(new ListItem("梧州市", "梧州市"));
                    cities.Add(new ListItem("贵港市", "贵港市"));
                    cities.Add(new ListItem("玉林市", "玉林市"));
                    cities.Add(new ListItem("钦州市", "钦州市"));
                    cities.Add(new ListItem("北海市", "北海市"));
                    cities.Add(new ListItem("防城港市", "防城港市"));
                    cities.Add(new ListItem("崇左市", "崇左市"));
                    cities.Add(new ListItem("百色市", "百色市"));
                    cities.Add(new ListItem("河池市", "河池市"));
                    cities.Add(new ListItem("来宾市", "来宾市"));
                    cities.Add(new ListItem("贺州市", "贺州市"));

                    break;
                case "内蒙古":
                    cities.Add(new ListItem("呼和浩特市", "呼和浩特市"));
                    cities.Add(new ListItem("包头市", "包头市"));
                    cities.Add(new ListItem("乌海市", "乌海市"));
                    cities.Add(new ListItem("赤峰市", "赤峰市"));
                    cities.Add(new ListItem("通辽市", "通辽市"));
                    cities.Add(new ListItem("呼伦贝尔市", "呼伦贝尔市"));
                    cities.Add(new ListItem("鄂尔多斯市", "鄂尔多斯市"));
                    cities.Add(new ListItem("乌兰察布市", "乌兰察布市"));
                    cities.Add(new ListItem("巴彦淖尔市", "巴彦淖尔市"));
                    cities.Add(new ListItem("兴安盟", "兴安盟"));
                    cities.Add(new ListItem("锡林郭勒盟", "锡林郭勒盟"));
                    cities.Add(new ListItem("阿拉善盟", "阿拉善盟"));

                    break;
                case "宁夏":
                    cities.Add(new ListItem("银川市", "银川市"));
                    cities.Add(new ListItem("石嘴山市", "石嘴山市"));
                    cities.Add(new ListItem("吴忠市", "吴忠市"));
                    cities.Add(new ListItem("固原市", "固原市"));
                    cities.Add(new ListItem("中卫市", "中卫市"));
                    break;
                case "青海":
                    cities.Add(new ListItem("西宁市", "西宁市"));
                    cities.Add(new ListItem("海东地区", "海东地区"));
                    cities.Add(new ListItem("海北藏族自治州(海晏县西海镇)", "海北藏族自治州(海晏县西海镇)"));
                    cities.Add(new ListItem("海南藏族自治州", "海南藏族自治州"));
                    cities.Add(new ListItem("黄南藏族自治州", "黄南藏族自治州"));
                    cities.Add(new ListItem("果洛藏族自治州", "果洛藏族自治州"));
                    cities.Add(new ListItem("玉树藏族自治州", "玉树藏族自治州"));
                    cities.Add(new ListItem("海西蒙古族藏族自治州", "海西蒙古族藏族自治州"));
                    break;
                case "新疆":
                    cities.Add(new ListItem("乌鲁木齐市", "乌鲁木齐市"));
                    cities.Add(new ListItem("克拉玛依市", "克拉玛依市"));
                    cities.Add(new ListItem("喀什地区", "喀什地区"));
                    cities.Add(new ListItem("阿克苏地区", "阿克苏地区"));
                    cities.Add(new ListItem("和田地区", "和田地区"));
                    cities.Add(new ListItem("吐鲁番地区", "吐鲁番地区"));
                    cities.Add(new ListItem("哈密地区", "哈密地区"));
                    cities.Add(new ListItem("克孜勒苏柯尔克孜自治州", "克孜勒苏柯尔克孜自治州"));
                    cities.Add(new ListItem("博尔塔拉蒙古自治州", "博尔塔拉蒙古自治州"));
                    cities.Add(new ListItem("昌吉回族自治州", "昌吉回族自治州"));
                    cities.Add(new ListItem("巴音郭楞蒙古自治州", "巴音郭楞蒙古自治州"));
                    cities.Add(new ListItem("伊犁哈萨克自治州", "伊犁哈萨克自治州"));
                    cities.Add(new ListItem("塔城地区", "塔城地区"));
                    cities.Add(new ListItem("阿勒泰地区", "阿勒泰地区"));
                    break;
                case "海南":
                    cities.Add(new ListItem("海口市", "海口市"));
                    cities.Add(new ListItem("三亚市", "三亚市"));
                    break;
                case "西藏":
                    cities.Add(new ListItem("拉萨市", "拉萨市"));
                    cities.Add(new ListItem("那曲地区", "那曲地区"));
                    cities.Add(new ListItem("昌都地区", "昌都地区"));
                    cities.Add(new ListItem("林芝地区(林芝县八一镇)", "林芝地区(林芝县八一镇)"));
                    cities.Add(new ListItem("山南地区", "山南地区"));
                    cities.Add(new ListItem("日喀则地区", "日喀则地区"));
                    cities.Add(new ListItem("阿里地区", "阿里地区"));
                    break;
                case "香港":
                   
                    break;
                case "澳门":
                    
                    break;
                case "台湾":
                    
                    break;
            }

            return cities;
        }

        protected void SaveButton_Click(object sender, EventArgs e)
        {
            try
            {
                string customerID = customerIDTxtBox.Text;
                string contact = contactTxtBox.Text;
                string phone = phoneTxtBox.Text;
                string mobilePhone = mobilePhoneTxtBox.Text;
                string password = passwordTxtBox.Text;
                string fax = faxTxtBox.Text;
                string companyName = companyNameTxtBox.Text;
                int roleType = Convert.ToInt32(RoleType.Customer);
                string email = emailTxtBox.Text;
                string address = addressTxtBox.Text;
                string fullName = customerNameTxtBox.Text;
                string comment = "";
                string validateResult = ValidateRegisterInfo();
                if (string.IsNullOrEmpty(validateResult))
                {
                    UserService userService = new UserService();
                    string addressRegion = "";
                    if (this.ddlProvince.SelectedValue.Equals("北京") || this.ddlProvince.SelectedValue.Equals("上海") || this.ddlProvince.SelectedValue.Equals("重庆") || this.ddlProvince.SelectedValue.Equals("天津"))
                    {
                        addressRegion += this.ddlProvince.SelectedValue + "市";
                    }
                    else if (this.ddlProvince.SelectedValue.Equals("香港") || this.ddlProvince.SelectedValue.Equals("澳门") || this.ddlProvince.SelectedValue.Equals("台湾"))
                    {
                        addressRegion += this.ddlProvince.SelectedValue;
                    }
                    else
                    {
                        addressRegion += this.ddlProvince.SelectedValue + "省";
                        addressRegion += this.ddlCity.SelectedValue;
                    }
                    userService.AddUser(customerID, contact, phone, mobilePhone, fax, companyName, password, roleType, email,
                        fullName, addressRegion + address, companyName, 0, 0, 0);

                    Response.Write("<script language='JavaScript'> alert( '您的注册信息已经成功提交，您现在可以登录了！');location.href= 'Default.aspx' </script> ");
                    //promptLbl.Text = "你已经成功注册，请返回登录页面登录。";
                    //promptLbl.Visible = true;
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "tip", "alert('" + validateResult + "');", true);
                }
            }
            catch (Exception ex)
            {
                promptLbl.Text = string.Format("系统错误：{0}", ex.Message);
                promptLbl.Visible = true;
            }
        }

        private string ValidateRegisterInfo()
        {
            string result = string.Empty;
            UserService service = new UserService();
            if (service.GetUserByName(customerIDTxtBox.Text) != null)
            {
                result = "用户ID已存在，请不要重复注册";
            }
            if (string.IsNullOrEmpty(result))
            {
                if (service.GetUserByCompanyName(customerNameTxtBox.Text) != null)
                {
                    result = customerNameTxtBox.Text + "已经注册，请联系神州数码客服中心010-58859855，不要重复注册";
                }
            }

            return result;
        }

        protected void CancelButton_Click(object sender, EventArgs e)
        {
            Response.Redirect("Default.aspx");
        }

        protected void provinceChanged(object sender, EventArgs e)
        {
            DropDownList ddl = sender as DropDownList;
            string provinceName = ddl.SelectedValue;

            this.ddlCity.Items.Clear();
            List<ListItem> cities = BindCity(provinceName);
            if (null != cities && cities.Count > 0)
            {
                this.ddlCity.Visible = true;
                foreach (ListItem item in cities)
                {
                    this.ddlCity.Items.Add(item);
                }
            }
            else
            {
                this.ddlCity.Visible = false;
            }
        }
    }
}
